package com.example.smartcitymovie;

import android.app.Activity;
import android.app.Application;
import android.content.SharedPreferences;

import com.google.gson.Gson;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * @Author: Machu
 * @Time: 2022/2/14 10:53
 * @Description: 功能描述
 */
public class MyApplication extends Application {

    public static SharedPreferences sharedPreferences;
    public static SharedPreferences.Editor sharedPreferencesEditor;
    public static Gson gson;
    private static HashMap<Integer, String> movieType = new HashMap<>();
    private static HashMap<Integer, String> PlayType = new HashMap<>();
    @Override
    public void onCreate() {
        super.onCreate();
        sharedPreferences = getSharedPreferences("data", MODE_PRIVATE);
        sharedPreferencesEditor = getSharedPreferences("data", MODE_PRIVATE).edit();
        gson = new Gson();
        movieType.put(4, "喜剧");
        movieType.put(8, "科幻");
        movieType.put(3, "动作");
        movieType.put(7, "战争");
        movieType.put(2, "爱情");
        movieType.put(6, "惊悚");
        movieType.put(1, "故事");
        movieType.put(5, "恐怖");
        PlayType.put(4,"4DX");
        PlayType.put(3,"IMAX");
        PlayType.put(2,"3D");
        PlayType.put(1,"2D");


    }

    public static SharedPreferences getSharedPreferences() {
        return sharedPreferences;
    }

    public static SharedPreferences.Editor getSharedPreferencesEditor() {
        return sharedPreferencesEditor;
    }

    public static Gson getGson() {
        return gson;
    }

    public static HashMap<Integer, String> getMovieType() {
        return movieType;
    }

    public static HashMap<Integer, String> getPlayType() {
        return PlayType;
    }
}
